<template>
	<view v-if="isInit" v-cloak>
		<noRecord v-if="menuInfo.list.length==0" :info="info" v-cloak></noRecord>
		<menuBox :menuInfo="menuInfo" v-else></menuBox>
	</view>
</template>

<script>
import menuBox from '@/wxcomponents/commonLayout/menu';
import noRecord from '@/wxcomponents/commonLayout/noRecord.vue';
import login from '@/libs/login.js';
import { getDictName, dectList } from '@/libs/common.js';
export default {
	data() {
		return {
			isInit:false,
			info:"没有实习申请记录！",
			menuInfo: {
				base: {
					tit: ['企业名称', '申请人', '状态'],
					menuProp: ['name', 'studentName', 'status'],
					class: 'threeCol'
				},
				list: []
			}
		};
	},
	async onLoad() {
		this.appylRecord();
	},
	methods: {
		async appylRecord() {
			let resp = await this.$http.post({
				url: '/enrollment/practiceApply/page'
			});
			let dictList = await dectList('dict_apply_status');
			resp.result.records.forEach(async (item, index) => {
				this.menuInfo.list.push({
					url: './practiceApplyDetail?data=' + JSON.stringify(item),
					name: this.shortStr(item.practiceEnterpriseName, 8),
					studentName: item.studentName,
					status: await getDictName(dictList, item.applyStatus),
					data: item,
				});
			});
			this.isInit = true
		}
	},
	components: {
		menuBox,
		noRecord
	}
};
</script>

<style lang="scss" scoped></style>
